package LeetCodeHot100TopInterview;

public class Q104_TreeMaxDepth {
    //二叉树[最大深度]
    public int maxDepth(TreeNode root) {
        if (root == null){
            return 0;
        }
        return process(root);
    }

    public int process(TreeNode root){

        if (root == null){
            return 0;
        }
        return Math.max(process(root.left), process(root.right)) + 1;
    }

}
